package com.spider.im.common.aspect;


import com.spider.im.common.constant.RespCodeEnum;
import lombok.Getter;

/**
 * 自定义业务异常
 */

@Getter
public class BusinessException extends RuntimeException {
    /**
     * 错误码
     */
    private final Integer errorCode;

    public BusinessException(RespCodeEnum respCodeEnum) {
        super(respCodeEnum.getDesc());
        this.errorCode = respCodeEnum.getCode();
    }
    public BusinessException(RespCodeEnum respCodeEnum,Throwable cause) {
        super(respCodeEnum.getDesc(), cause);
        this.errorCode = respCodeEnum.getCode();
    }
    public BusinessException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }


}